package global

import (
	"github.com/gin-gonic/gin"
	"github.com/go-redis/redis/v8"
	"golang.org/x/sync/singleflight"
	"gorm.io/gorm"
)

var (
	DB                      *gorm.DB
	Redis                   *redis.Client
	GVA_Concurrency_Control = &singleflight.Group{}
)

// GetPhone 从上下文获取phone
func GetPhone(c *gin.Context) string {
	phone, _ := c.Get("phone")
	return phone.(string)
}
